import OfficialIndex from './officialIndex'
import IndexMain from './index'

const officialRouter = {

  // path: '/',
  getChildRoutes(location, cb) {
    require.ensure([], function (require) {
      cb(null, [
        {
          path: 'web',  
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./index'))
            })
          }
        },
        {
          path: 'renter',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./renter'))
            })
          }
        },
        {
          path: 'landlord',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./landlord'))
            })
          }
        },
        {
          path: 'suppliersService',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./suppliersService'))
            })
          }
        },
        {
          path: 'financialSupport',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./financialSupport'))
            })
          }
        },
        {
          path: 'aboutUs',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./aboutUs'))
            })
          }
        },
        {
          path: 'funderApply',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./funderApply'))
            })
          }
        },
        {
          path: 'landlordApply',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./landlordApply'))
            })
          }
        },
      ])
    })
  },

  indexRoute: {
    getComponents(location, cb) {
      require.ensure([], function (require) {
        cb(null, IndexMain)
      })
      return cb()
    }
  },

 


  getComponents(nextState, cb) {
    require.ensure([], function (require) {
      cb(null, OfficialIndex)
    })
  }

}

export default officialRouter;

